package com.igeek.javase.ch02;

import java.util.Scanner;

/*
 *@author wangpeng
 *2023/7/11 11:32
 *@description TODO
 */
public class SwitchDemo {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第一个数字：");
        int i = sc.nextInt();
        System.out.println("请输入第二个数字：");
        int j = sc.nextInt();
        System.out.println("请输入运算符号");
        String s = sc.next();

        switch (s)
        {
            case "+":
                System.out.println("i + j =" + (i+j));
                break;
            case "-":
                System.out.println("i - j =" + (i-j));
                break;
            case "*":
                System.out.println("i * j =" + (i*j));
                break;
            case"/":
                System.out.println("i / j =" + (i/j));
                break;
            default:
                System.out.println("输入的字符不存在，请检查输入！");
        }
    }
}
